package structuresDonnees.iterateur;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;

public class IteratorExample {
	
	public static void main(String[] args) {
		ArrayList<Integer> chiffres = new ArrayList<Integer>(); 
		int[] tmpList = {1,3,8,5,7,6,4,2,9};
		for (int i = 0; i < tmpList.length; i++) 
		{
			chiffres.add(tmpList[i]);
		}
		
		
		System.out.println("====Avant sort :====");
		for(Iterator<Integer> it = chiffres.iterator();it.hasNext();)
		{
			int c = it.next();
			System.out.println("Je vaux "+c);
		}
		
		System.out.println("====Apres sort :====");
		Collections.sort(chiffres);
		
		for(Iterator<Integer> it = chiffres.iterator();it.hasNext();)
		{
			int c = it.next();
			System.out.println("Je vaux "+c);
		}
		
		System.out.println();
	}
}
